<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>作业2</title>
</head>

<body>
    <script>
        let per = {
            gender: '男',
            age: 18,
            hobbys: '上网',
            talk: function () {
                console.log('这里是per在说话')
            },
            eat: function () {
                console.log(`嗯~真好吃~`)
            }
        }
        for (k in per) {
            if (typeof per[k] === 'function') {
                per[k]()
            } else {
                console.log(per[k])
            }
        }
    </script>
</body>

</html>